package com.hzit.bj01.controller;

import com.hzit.bj01.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class IndexController {

    /**
     * 通过mvc 加载页面
     * @return
     */
    @RequestMapping("/show")
    public String showIndex(Model model){

        System.out.println("-------showIndex----");

        List<User> list = new ArrayList<User>();


        User u = new User("t1","111");

        list.add(u);

        u = new User("t2","222");

        list.add(u);

        model.addAttribute("list",list);

        return "user";
    }
}
